package com.example.ytyproject.component;

import com.example.ytyproject.config.SpringContextUtil;
import com.example.ytyproject.config.exception.AppException;
import com.example.ytyproject.entity.ShopsBase;
import com.example.ytyproject.service.ShopsBaseService;
import org.apache.commons.lang3.StringUtils;

public class CheckComponent {

    // 校验商铺新增参数
    public static void checkShopAddParam(ShopsBase param) {
        String shopName = param.getShopName();
        if (StringUtils.isEmpty(shopName)) {
            throw new AppException("商铺名称不能为空！");
        }
        String areaCode = param.getAreaCode();
        if (StringUtils.isEmpty(areaCode)) {
            throw new AppException("商铺地址不能为空！");
        }
    }


}
